import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { IRootState } from '../types/storeTypes/storyTypes'
import { Button, Affix } from 'antd'

const Home: React.FC = (props: any) => {
    const count = useSelector<IRootState, number>(state => state.counter.count);
    const dispatch = useDispatch();
    console.log(props);
    return <div>
        {count}
        <Affix >
            <Button type="primary" >
                Affix top
            </Button>
        </Affix>
        <Button onClick={() => dispatch({ type: 'addition' })}>点击+</Button>
        <button onClick={() => dispatch({ type: 'addition' })}>+1</button>
    </div>
}

export default Home;